<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        #asas{
            background-color: red;
            height: 200px;
            margin-top: 5000px;
            
        }
        .ss{
            height: 400px;
            overflow: auto;
            position: absolute;
            width: 600px;
        }
    </style>
</head>
<body>
    <div class="ss">
        <div id="asas"></div>
    </div>
    
    <script>
        a=document.getElementById('asas')
        document.querySelector('.ss').onscroll=function(){
            console.log(a.offsetTop);
        }
    </script>
</body>
</html>